import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

// 引入页面组件
import Home from '@/views/home/home.vue'
import Login from '@/views/login/index.vue'
import Record from '@/views/record/record.vue'
import detail from '@/views/recordDetail/recordDetail.vue'
import speechToText from '@/views/speechToText/speechToText.vue'
import AbstractReading from '@/views/abstract/abstractReading.vue'
import RequestInstructions from '@/views/requestInstructions/requestInstructions.vue'
import ceshi from '@/views/ceshi.vue'

const routers = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    component: Login,
  },

  {
    path: '/home',
    component: Home,
  },
  {
    path: '/record',
    component: Record,
  },
  {
    path: '/detail/:id',
    component: detail,
  },
  {
    path: '/speechToText',
    component: speechToText,
  },
  {
    path: '/abstract',
    component: AbstractReading,
  },
  {
    path: '/requestInst',
    component: RequestInstructions,
  },
  {
    path: '/ceshi',
    component: ceshi,
  },
]

const router = new VueRouter({
  mode: 'history', // 去掉url中的#
  routes: routers,
})

export default router
